/* 通用样式文件 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础字体和颜色 */
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* 政府风格配色方案 */
:root {
    --primary-red: #c41e3a;
    --primary-gold: #ffd700;
    --secondary-red: #a0172e;
    --secondary-gold: #e6c200;
    --light-red: #f8f0f0;
    --light-gold: #fffbf0;
    --text-dark: #333;
    --text-light: #666;
    --text-muted: #999;
    --border-light: #e0e0e0;
    --background-light: #fafafa;
    --white: #ffffff;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-red: rgba(196, 30, 58, 0.2);
}

/* 通用按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

        .btn-primary {
            background: var(--primary-red);
            color: var(--white);
        }

        .btn-primary:hover {
            background: var(--secondary-red);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px var(--shadow-red);
        }

        .btn-secondary {
            background: var(--primary-gold);
            color: var(--text-dark);
        }

        .btn-secondary:hover {
            background: var(--secondary-gold);
            transform: translateY(-1px);
        }

.btn-outline {
    background: transparent;
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
}

.btn-outline:hover {
    background: var(--primary-red);
    color: var(--white);
}

.btn:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 通用表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--background-light);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-red);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* 通用卡片样式 */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow-light);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 32px var(--shadow-medium);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--light-red);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 20px;
    border-top: 1px solid var(--border-light);
    background: var(--background-light);
}

/* 通用网格布局 */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* 通用间距 */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 40px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 40px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }
.p-5 { padding: 40px; }

/* 通用文本样式 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-red); }
.text-secondary { color: var(--text-light); }
.text-muted { color: var(--text-muted); }
.text-success { color: #2d5a2d; }
.text-warning { color: #b8860b; }
.text-danger { color: var(--primary-red); }

.text-bold { font-weight: bold; }
.text-normal { font-weight: normal; }
.text-light { font-weight: 300; }

/* 通用消息提示 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid;
}

.alert-success {
    background: #efe;
    color: #2d5a2d;
    border-left-color: #2d5a2d;
}

.alert-warning {
    background: #fff8e1;
    color: #b8860b;
    border-left-color: #b8860b;
}

.alert-danger {
    background: #fee;
    color: var(--primary-red);
    border-left-color: var(--primary-red);
}

.alert-info {
    background: #e3f2fd;
    color: #1976d2;
    border-left-color: #1976d2;
}

/* 通用加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 通用模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px var(--shadow-medium);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--light-red);
    border-radius: 12px 12px 0 0;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-light);
    background: var(--background-light);
    border-radius: 0 0 12px 12px;
    text-align: right;
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--primary-red);
}

/* 通用表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    background: var(--light-red);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.table td {
    font-size: 14px;
    color: var(--text-light);
}

.table tbody tr:hover {
    background: var(--background-light);
}

/* 通用分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    background: var(--white);
    color: var(--text-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: var(--light-red);
    color: var(--primary-red);
}

.pagination button.active {
    background: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
}

.pagination button:disabled {
    background: var(--background-light);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px 12px;
    }
}

/* 通用工具类 */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-full { border-radius: 50%; }

.shadow { box-shadow: 0 2px 8px var(--shadow-light); }
.shadow-lg { box-shadow: 0 8px 32px var(--shadow-medium); }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.select-none { user-select: none; }
.select-all { user-select: all; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }
